Hamilton’s rule is a formula that defines whether or not an apparently altruistic behaviour will evolve in a given situation. First proposed by William Hamilton, one of the greatest evolutionary biologists of this century, the rule states that the evolution of altruism depends on how expensive the altruistic act is to the donor, on how beneficial the act is to the recipient, and ­ crucially ­ on how related the donor is to the recipient.
Essentially, if the cost is large, the behaviour will not evolve unless it will strongly benefit close relatives. The more related the donor is to the recipient, the more genes they share. So by helping a close relative, an animal is often helping the survival of their own genes.